﻿using System;
using System.Management;
using System.Net;

namespace CrazyTalk.Config
{
    public class BaseSystemInfo
    {
        public static bool AllowNullPassword = true;
        public static string AppIco = string.Empty;
        //public static string AppPath = Application.StartupPath;
        public static string BugFeedback = "mailto:40137139@QQ.com?subject=对系统使用的反馈&body=这里输入您宝贵的反馈";
        public static string BusinessDbConnection;
        public static bool CheckIPAddress = false;
        public static bool CheckMACAddress = false;
        public static bool CheckOnLine = false;
        public static bool CheckOnLineLimit = false;
        public static bool ClientCache = false;
        public static string Code = string.Empty;
        public static string CompanyFullName = "广州慧康信息科技有限公司";
        public static string CompanyPhone = "020-61649778";
        public static string ConfigPassword = "123456";
        public static string ConfigUsername = "sa";
        public static string Copyright = "Copyright 2010-2013 HiKang Technology";
        public static string Culture = "zh-CN";
        public static string CurrentLanguage = string.Empty;
        public static string CustomerPhone = "020-61649778";
        public static string DateFormat = "yyyy-MM-dd";
        public static string DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
        public static bool EncryptPassword = false;
        public static string ErrorReportMailAddress = "40137139@qq.com";
        public static string ErrorReportMailServer = "smtp.qq.com";
        public static string ErrorReportPassword = "";
        public static string ErrorReportTo = "";
        public static string ErrorReportUsername = "";
        public static bool EventLog = false;
        public static string FormIco = string.Empty;
        public static string HelpNamespace = string.Empty;
        public static string IEDownloadUrl = "http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/ie6setup.exe";
        public static string IPAddress = string.Empty;
        public static bool IsAdministrator = false;
        public static string LastUpdate = "2008.07.22";
        public static int LockNoWaitCount = 5;
        public static int LockNoWaitTickMilliSeconds = 30;
        public static bool LogException = true;
        public static bool Logined = false;
        public static bool LogSQL = false;
        public static string MACAddress = string.Empty;
        public static string MainAssembly = string.Empty;
        public static bool MatchCase = true;
        public static bool NeedLogin = false;
        public static bool NeedRegister = false;
        public static int OnLineCheck = 60;
        public static int OnLineLimit = 0;
        public static int OnLineTime0ut = 180;
        public static string Password = string.Empty;
        public static string ProcessID = string.Empty;
        public static string ProcessName = string.Empty;
        public static bool RecordLoginLog = true;
        public static string Role = string.Empty;
        public static string RoleFullName = string.Empty;
        public static bool SavePassword = true;
        public static bool ServerCache = false;
        public static bool ShowInformation = true;
        public static string StaffID = string.Empty;
        public static string StartupPath = string.Empty;
        public static string SUID = string.Empty;
        public static string Themes = string.Empty;
        public static string TimeFormat = "HH:mm:ss";
        public static int TopLimit = 200;
        public static bool UpdateVisit = true;
        public static string UploadDirectory = "Document/";
        public static string UserCompanyCode = string.Empty;
        public static string UserCompanyFullName = string.Empty;
        public static string UserCompanyID = string.Empty;
        public static string UserDepartmentCode = string.Empty;
        public static string UserDepartmentFullName = string.Empty;
        public static string UserDepartmentID = string.Empty;
        public static string UserID = string.Empty;
        public static string Username = string.Empty;
        public static string UserRealname = string.Empty;
        public static string Version = "1.2";
        public static string WebProxy = string.Empty;
        public static string WebServicePassword = "admin";
        public static string WebServiceUsername = "admin";

        public static string GetCPUSerialNo()
        {
            string str = string.Empty;
            ManagementClass class2 = new ManagementClass("Win32_Processor");
            foreach (ManagementObject obj2 in class2.GetInstances())
            {
                return obj2.Properties["ProcessorId"].Value.ToString();
            }
            return str;
        }

        public static string GetHardDiskInfo()
        {
            string str = string.Empty;
            ManagementClass class2 = new ManagementClass("Win32_DiskDrive");
            foreach (ManagementObject obj2 in class2.GetInstances())
            {
                return (string)obj2.Properties["Model"].Value;
            }
            return str;
        }

        public static string GetIPAddress()
        {
            return Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString();
        }

        public static string CommonWebService
        {
            get
            {
                return BaseConfiguration.Instance.CommonWebService;
            }
            set
            {
                BaseConfiguration.Instance.CommonWebService = value;
            }
        }

        public static string CustomerCompanyName
        {
            get
            {
                return BaseConfiguration.Instance.CustomerCompanyName;
            }
        }

        public static string DbConnectionString
        {
            get
            {
                return BaseConfiguration.Instance.DbConnectionString;
            }
            set
            {
                BaseConfiguration.Instance.DbConnectionString = value;
            }
        }

        public static string FileWebService
        {
            get
            {
                return BaseConfiguration.Instance.FileWebService;
            }
            set
            {
                BaseConfiguration.Instance.FileWebService = value;
            }
        }

        public static bool RecordLog
        {
            get
            {
                return BaseConfiguration.Instance.RecordLog;
            }
            set
            {
                BaseConfiguration.Instance.RecordLog = value;
            }
        }

        public static string RootMenuID
        {
            get
            {
                return BaseConfiguration.Instance.RootMenuID;
            }
        }

        

        public static string SoftFullName
        {
            get
            {
                return BaseConfiguration.Instance.SoftFullName;
            }
        }

        public string SoftName
        {
            get
            {
                return BaseConfiguration.Instance.SoftName;
            }
            set
            {
                BaseConfiguration.Instance.SoftName = value;
            }
        }

        public static bool UseLicensedPermission
        {
            get
            {
                return BaseConfiguration.Instance.UseLicensedPermission;
            }
            set
            {
                BaseConfiguration.Instance.UseLicensedPermission = value;
            }
        }

       

        public static bool UseScopePermission
        {
            get
            {
                return BaseConfiguration.Instance.UseScopePermission;
            }
            set
            {
                BaseConfiguration.Instance.UseScopePermission = value;
            }
        }

        public static string WebService
        {
            get
            {
                return BaseConfiguration.Instance.WebService;
            }
            set
            {
                BaseConfiguration.Instance.WebService = value;
            }
        }

        public static string WorkReportWebService
        {
            get
            {
                return BaseConfiguration.Instance.WorkReportWebService;
            }
            set
            {
                BaseConfiguration.Instance.WorkReportWebService = value;
            }
        }

        public static string ATMMachineRoleID
        {
            get
            {
                return BaseConfiguration.Instance.ATMMachineRoleID;
            }
        }
    }
}

